Skip to content

Offline Mode - UART and GPS #787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 235 commits into from
Aug 12, 2025
Merged

Offline Mode - UART and GPS #787

merged 235 commits into from
Aug 12, 2025

Conversation

brentru
Copy link
Member

@brentru brentru commented Jul 30, 2025

This pull request brings UART and GPS modules into WipperSnapper's offline mode and the upcoming v2 (online) firmware.

Since these two components are completely rewritten for the WipperSnapper API-v2, they are not yet ready to be added to WipperSnapper Online until the IO Production broker supports WipperSnapper API v2.

UART (v2 refactor) 🔧 - UART has been fully refactored and rebuilt to support components other than the PM25 AQ Sensor. The UART component architecture is similar to the i2c component and provides a general driver base class (drvBase) for creating a new UART driver.

  • UART now supports sensor.proto API, shared by other sensing classes
  • UART may support output components (such as servos or motors) in the future, its API has been extended to allow for this capability
  • NEW UART Components: PM25 AQ Sensor, US100 Ultrasonic Sensor, Adafruit Ultimate GPS Module

GPS 🛰️ - GPS functionality has been added to WipperSnapper! This is a new feature ✨

Resolves:
#360
#727
#755
#753

@brentru brentru requested a review from tyeth August 6, 2025 19:15
@brentru
Copy link
Member Author

brentru commented Aug 6, 2025

@tyeth This pull request is ready for review. Please note that the areas of note are within ws_sdcard and the GPS module. UART has already been reviewed.

Copy link
Member

@tyeth tyeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great generally

Comment on lines +493 to +495
msg_uart_add.cfg_serial.use_sw_serial = component["useSwSerial"] | false;
msg_uart_add.cfg_serial.sw_serial_invert =
component["swSerialInvert"] | false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should eventually be added to the offline config tool for export.
To be fair the use_sw_serial thing is a board/device specific setting which the firmware knows, and swSerialInvert too perhaps? So the defaults of false may be incorrect or want to be #if HAS_SW_SERIAL guarded

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added guard around these funcs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the false default value for useSwSerial be true if HAS_SW_SERIAL=1 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think so?

If the "useSwSerial" in JSON is set to true, it sets msg_uart_add.cfg_serial.use_sw_serial = true, otherwise false

@brentru brentru requested a review from tyeth August 8, 2025 15:44
Copy link
Member

@tyeth tyeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good Brent, thanks for making the software serial implementation.
Spotted some old debug logging on gps, maybe that's useful for now to leave on or have behind a flag, left minor comment

@tyeth tyeth merged commit 8fff556 into offline-mode Aug 12, 2025
41 checks passed
@tyeth tyeth deleted the offline-mode-uart-migrate branch August 12, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants